package gfx;

public class GraphicSprite{
	
	/*** ATTRIBUTS ***/
	
	private int x; //sprite's position in x 
	private int y; //sprite's position in y
	private int frame; //sprite's number in the image
	private GraphicImage image;
	
	/*** FIN ATTRIBUTS ***/
	
	
	/*** ACCESSEURS ***/
	
	public int getX() {
		return x;
	}
	
	public int getY() {
		return y;
	}
	
	public void setCoordinates(int x, int y)throws IllegalArgumentException  {
		this.x = x ;//no conditions
		this.y = y; //no conditions
	}
		
	public int getFrame() {
		return frame;
	}
	
	public void setFrame(int frame) throws IllegalArgumentException {
		if (frame>=0)
			this.frame =frame;
		else
			throw new IllegalArgumentException ("Class GraphicSprites [class setFrame] frame is invalid (value < 0)");
	}
	
	public GraphicImage getImage() {
		return image;
	}
	
	public void setImage(GraphicImage image) throws IllegalArgumentException {
		this.image = image;
	}
	
	/*** FIN ACCESSEURS ***/
	
	
	/*** CONSTRUCTEUR ***/
	
	public GraphicSprite (int x, int y, int frame, GraphicImage image){
		this.setCoordinates (x,y);
		this.setFrame(frame);
		this.setImage(image);
	}
	
	/*** FIN CONSTRUCTEUR ***/
	

}
